<template>
    <div class="caseAdd">
            <div class="add-top flex p-l">
                <p>所在位置：</p>
                <router-link to='/index/caseIndex' tag="a">案件管理</router-link>
                <p><i class="el-icon-arrow-right"></i></p>
                <p>案件修改</p>
            </div>
             <div class="add-content flex">
                <div class="add-p flex">
                    <span @click="closeBox()" class="flex">
                   <i class="el-icon-close" ref="icon_right"></i>
                    </span>
                    </div>


                <div class="add-userinfo flex userinfoc" v-for="(v,i) in customerList" :key="i">
                    
                <p class="add-userinfo-p">客户基本信息<span style="font-size:14px;">(此模块不可修改)</span></p>
                <div class="flex add-userinfo-index">
                <div class="add-userinfo-left flex sselct">
                <div class="flex"><p class="title">客户类型</p> 
                  <el-select v-model="v.customValue" placeholder="*请选择" @change="changeCustomType()" disabled="disabled"><el-option v-for="item in v.customTypeArr" :key="item.Id" :label="item.Value" :value="item.Id"></el-option></el-select>
                        </div>
                        <div class="flex" slot="reference"><p class="title">客户名称(中)</p><input type="text" class="common-input" placeholder="*必填" v-model="v.search"  maxlength="30" disabled="disabled"/></div>
                     <div class="flex" v-show="v.customValue==3||v.customValue==14"><p class="title">身份证号</p> <input type="text" class="common-input" placeholder="*必填" v-model="v.cardNo" maxlength="30" disabled="disabled"/></div>
                    <div class="flex" v-show="v.customValue!=3&&v.customValue!=14"><p class="title">纳税人编号</p> <input type="text" class="common-input" placeholder="*必填" v-model="v.cardNo" maxlength="30" disabled="disabled"/></div>
                    <div class="flex"><p class="title">省/市地区</p> 
                    <!-- <input type="text" class="common-input" placeholder="*必填" v-model="province"/> -->
                     <el-cascader
                         size="large"
                         :options="options"
                         v-model="v.selectedOptions"
                         @change="handleChange"
                         disabled="disabled"
                         >
                    </el-cascader>
                    </div>
                    <!-- <div class="flex"><p class="title">详细地址</p> <input type="text" class="common-input" placeholder="*必填" v-model="address"/></div> -->

                </div>
                  <div class="add-userinfo-left selectInput flex userInfo-first sselct">
                        
                        <div class="flex" v-show="v.customValue!=3&&v.customValue!=14"><p class="title">所属行业</p>
                  <el-select v-model="v.suoshuValue" placeholder="*请选择" disabled="disabled"><el-option v-for="item in v.suoshuhangyeArr" :key="item.Id" :label="item.Value" :value="item.Id"></el-option></el-select>                        
                        </div>
                        <div class="flex" v-show="customValue!=3&&customValue!=14"><p class="title">职务</p>
                        <input type="text" class="common-input" placeholder="选填" v-model="v.value2" disabled="disabled"/>
                  <!-- <el-select v-model="JobListValue" placeholder="*请选择"><el-option v-for="item in JobListArr" :key="item.Id" :label="item.Value" :value="item.Id"></el-option></el-select>                         -->
                         </div> 
                    <div class="flex"><p class="title">联系电话</p> <input type="text" class="common-input" placeholder="*必填" disabled="disabled" v-model="v.tel"  maxlength="11"/></div>
                    <div class="flex"><p class="title">是否常年客户</p>
                  <el-select v-model="v.isValue" placeholder="*请选择" disabled="disabled"><el-option v-for="item in v.isValueArr" :key="item.Id" :label="item.Value" :value="item.Id"></el-option></el-select>                        
                        </div>
                   

                    </div>
                    </div>
                   <div class="address">
                       <div class="flex"><p class="address-title">详细地址</p> <input type="text " disabled="disabled" class="common-input long-width" placeholder="*必填" v-model="v.address" maxlength="50"/></div>
                       </div> 
                 </div>


                 <div class="add-caseinfo add-userinfo flex">
                        <p class="add-userinfo-p">案件基本信息</p>
                <div class="flex add-userinfo-index">
                <div class="add-userinfo-left flex">
                    <div class="flex selectInput1" id="selectInput1">
                    <p class="title">选择案件类型</p>
                    <!-- <el-select  v-model="caseValue" placeholder="*请选择"><el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option></el-select> -->
                    <el-select v-model="caseValue" placeholder="*请选择" @change="getSelectChildeMenu(caseValue)">
                    <el-option v-for="item in optionMenu" :key="item.Id" :label="item.Category_Name"  :value="item.Id"> </el-option>
                   </el-select>
                    <!-- <el-select  v-model="caseValue2" placeholder="*请选择"><el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option></el-select> -->
                    <el-select v-model="caseValue2" placeholder="*请选择"> 
                  <el-option v-for="(item,index) in optionChildMenu" :key="index" :label="item.Value"  :value="item.Id"> </el-option>
                 </el-select>
                    </div>
                    <div class="flex"><p class="title">案件名称</p><input type="text" class="common-input" placeholder="*必填" v-model="caseName" maxlength="50"/></div>
                  <div class="flex selectInput1" id="selectInput1">
                        <p class="title">案由</p> 
                          <el-select v-model="caseWhy" placeholder="*请选择" @change="changeCaseReson(caseWhy)">
                             <el-option v-for="item in CaseResonArr" :key="item.Id" :label="item.Category_Name"  :value="item.Id"> </el-option>
                         </el-select>
                            <el-select v-model="caseWhy1" placeholder="*请选择" style="overflow-x:hidden;width:150px"> 
                           <el-option v-for="item in CaseResonArr1" :key="item.Id" :label="item.Value"  :value="item.Id"> </el-option>
                            </el-select>
                    </div>
                    <!-- <div class="flex">

                        <p class="title">案由</p> 
                         <el-select v-model="caseWhy" placeholder="*请选择">
                         <el-option v-for="(item,index) in CaseResonArr" :key="index" :label="item.Value"  :value="item.Id"> </el-option>
                         </el-select>
                    </div> -->
                   
                   
                    <div class="flex"><p class="title">受理机关</p> <input type="text" class="common-input" placeholder="选填" v-model="compony" maxlength="30"/></div>
                   
                 
                    <!-- <div class="flex"><p class="title">对方当事人</p> <input type="text" class="common-input" placeholder="*必填" v-model="oppositeParty"/></div> -->
                   
                    <!-- <div class="flex"><p class="title">详细地址</p> <input type="text" class="common-input" placeholder="*必填"/></div> -->
                </div>
                  <div class="add-userinfo-left flex">
                        <div class="flex"><p class="title f-f">案情简介</p> 
                        <textarea name="" id="" cols="40" rows="8" class="textarea" v-model="textarea" placeholder="选填" maxlength="300"></textarea>
                        </div>
                        <!-- <div class="flex" style=" justify-content: flex-start;align-items: center;">
                             
                                <p class="title">对方当事人</p>
                                <input type="text" class="common-input" placeholder="*必填" v-model="oppositeParty[0].name"/>
                                 <span @click="addOppositeParty()" style="margin-left:20px;cursor: pointer;"><i class="el-icon-circle-plus" ></i> </span>
    
                        </div>
                         
                         <div class="flex" style=" justify-content: flex-start;align-items: center;" v-for="(v,i) in oppositePartyArr" :key="i">
                             
                                <p class="title">对方当事人</p>
                                <input type="text" class="common-input" placeholder="*必填" v-model="oppositeParty[i+1].name"/>
                                 <div class="input-icon" @click="deleteLine(i,oppositePartyArr)" style="margin-left:20px;cursor: pointer;"><i class="el-icon-remove"></i></div>
                             
                        </div> -->
                    <!-- <div class="flex" v-if="caseValue==4||caseValue==8||caseValue==11"><p class="title">对方当事人</p> <input type="text" class="common-input" placeholder="*必填" v-model="oppositeParty" maxlength="50"/></div>
                    <div class="flex" v-else><p class="title">对方当事人</p> <input type="text" class="common-input" placeholder="选填" v-model="oppositeParty" maxlength="50"/></div> -->
                       <!-- 判断当v-if="caseValue==4||caseValue==8||caseValue==11"时必填 -->
                        <div v-if="caseValue==4||caseValue==8||caseValue==11">
                             <div class="flex" style=" justify-content: flex-start;align-items: center;">
                             
                                <p class="title">对方当事人</p>
                                <input type="text" class="common-input" placeholder="*必填" v-model="input1Arr[0].partyName" maxlength="50"/>
                                 <span @click="pushPartyInfo()" style="margin-left:20px;cursor: pointer;"><i class="el-icon-circle-plus" style="color:#7E2C2E"></i> </span>
    
                        </div>
                         
                         <div class="flex" style=" justify-content: flex-start;align-items: center;" v-for="(v,i) in PartyInfo" :key="i">
                                <p class="title">对方当事人</p>
                                <input type="text" class="common-input" placeholder="*必填" v-model="input1Arr[i+1].partyName" maxlength="50"/>
                                 <div class="input-icon" @click="deleteLine(i,PartyInfo,input1Arr)" style="margin-left:20px;cursor: pointer;"><i class="el-icon-remove" style="color:#7E2C2E"></i></div>
                        </div>
                        </div>
                        <!-- else -->
                        <div v-else>
                             <div class="flex" style=" justify-content: flex-start;align-items: center;">
                             
                                <p class="title">对方当事人</p>
                                <input type="text" class="common-input" placeholder="选填" v-model="input1Arr[0].partyName" maxlength="50"/>
                                 <span @click="pushPartyInfo()" style="margin-left:20px;cursor: pointer;"><i class="el-icon-circle-plus" style="color:#7E2C2E"></i> </span>
    
                        </div>
                         
                         <div class="flex" style=" justify-content: flex-start;align-items: center;" v-for="(v,i) in PartyInfo" :key="i">
                                <p class="title">对方当事人</p>
                                <input type="text" class="common-input" placeholder="选填" v-model="input1Arr[i+1].partyName" maxlength="50"/>
                                 <div class="input-icon" @click="deleteLine(i,PartyInfo,input1Arr)" style="margin-left:20px;cursor: pointer;"><i class="el-icon-remove" style="color:#7E2C2E"></i></div>
                        </div>
                        </div>
                    <div class="flex"><p class="title">标的额</p> <input type="text" class="common-input" placeholder="选填" v-model="biaodie"/></div>
                    </div>
                    </div>
                 </div>
                 
                <div class="add-lawyer-parent flex">
                <div class="add-lawyer  flex">
                <div class="add-lawyer-title flex"> 
                     <p class="add-userinfo-p">案件律师信息</p>
                     <span @click="pushUserInfo()"><i class="el-icon-circle-plus" ></i> 添加案件成员</span>
                 </div>  
                <div class="flex  add-lawyer-index">
                    
                    <div class="flex">
                        <p class="title">姓名</p>
                         <p class="title">职务</p>
                           <p class="input-icon"></p>
                    </div>
                
                <div class="flex" style="height:50px"> 
                   <el-popover placement="bottom-start" width="200" trigger="click" v-model="inputArr[0].visible">
                        <input type="text" slot="reference" class="common-input lawyer-input" placeholder="*必填" v-model="inputArr[0].laywerName"  readonly="readonly">                      
                           <el-autocomplete
                            class="inline-input"
                            v-model="inputArr[0].laywerName1"
                            :fetch-suggestions="querySearch" 
                            placeholder="*必填内容"
                            @select="handleSelect"
                            @blur="blurInput()"
                             prefix-icon="el-icon-search"
                            > 
                            </el-autocomplete>
                        </el-popover>

                         <el-select v-model="inputArr[0].Case_Rule_Id"  placeholder="*请选择">
                         <el-option v-for="item in layerSelectArr" :key="item.Id" :label="item.Value" :value="item.Id"></el-option>
                        </el-select>   
                        <div class="input-icon"></div>
                    </div>


                      <div class="flex" v-for="(v,i) in userInfo" :key="i" style="height:50px">
                        <el-popover placement="bottom-start" width="200" trigger="click" v-model="inputArr[i+1].visible" >
                        <input type="text" slot="reference" class="common-input lawyer-input" placeholder="*必填" v-model="inputArr[i+1].laywerName"  readonly="readonly">
                           <el-autocomplete
                            class="inline-input"
                            v-model="inputArr[i+1].laywerName1"
                            :fetch-suggestions="querySearch" 
                            placeholder="*必填内容"
                            @select="((item)=>handleSelect1(item,i))"
                             prefix-icon="el-icon-search"
                              @blur="blurInput1(i)"
                            > 
                            </el-autocomplete>
                        </el-popover>
                        <el-select v-model="inputArr[i+1].Case_Rule_Id"  placeholder="*请选择" style="height:30px;width:100px;margin-top: 10px;">
                         <el-option v-for="item in layerSelectArr" :key="item.Id" :label="item.Value" :value="item.Id"></el-option>
                        </el-select>  
                        <div class="input-icon" @click="deleteLine(i,userInfo,inputArr)"><i class="el-icon-remove"></i></div>
                    </div>
                     
                    </div>
                    </div>

              
                <div class="add-lawyer  lex">
                <div class="add-lawyer-title flex"> 
                     <p class="add-userinfo-p">服务内容</p>
                     <!-- <span @click="pushPartyInfo()"><i class="el-icon-circle-plus"></i> 其他当事人</span> -->
                 </div>  
                <div class="flex  add-lawyer-index"  style="width:90%;margin-top:10px;">
             
                     <!-- <textarea name="" id="" cols="40" rows="8" v-model="Service_Content" class="serve_content"></textarea> -->
                     <!-- <div class="serve_content" @click="openEditor()" v-html="Service_Content"></div> -->
                      <quill-editor v-model="Service_Content" ref="myQuillEditor" :options="editorOption" style="width:428px;" class="ql-editor" ></quill-editor>
                     
                    </div>
                    </div>
                 </div>
               

                 <div class="add-method flex">
                     <div class="add-method-index flex">
                    <p>收费方式</p>
                     <div class="select-input">
                     <el-select v-model="costValue" placeholder="*请选择" @change="changeCostWay(costValue)">
                         <el-option v-for="item in costWay" :key="item.Id" :label="item.Value" :value="item.Id"></el-option>
                    </el-select>                           
                     </div>
                     </div>
                     </div> 

                   


                    <div class="add-Pay add-job" v-show="costId == 9">
                    <div class="add-Pay-index flex">
                   <div class="add-Pay-index-child">
                    <div class="flex">
                        <p class="title">付款日期</p>
                        <p class="title">收费金额</p>
                        <p class="title">描述</p>
                         <p class="input-icon"></p>
                    </div>
                    <div class="flex">
                         <el-date-picker
                        v-model="timeArr[0].Payment_Time"
                        type="date"
                         value-format="yyyy-MM-dd"
                        placeholder="选择日期时间">
                        </el-date-picker>
                        
                    <!-- <input type="text" class="common-input lawyer-input" placeholder="*必填" v-model="timeArr[0].Payment_Time"/> -->
                    <input type="text" class="common-input lawyer-input" placeholder="*必填" v-model="timeArr[0].Charge_Amount"/>
                    <input type="text" class="common-input lawyer-input" placeholder="*必填" v-model="timeArr[0].Describe"/>
                       <div class="input-icon"></div>
                    </div>
                    <div class="flex" v-for="(v,i) in payDate" :key="i">
                        
                          <el-date-picker
                          class="time_input"
                          v-model="timeArr[i+1].Payment_Time"
                          value-format="yyyy-MM-dd"
                            type="date"
                            placeholder="选择日期时间">
                        </el-date-picker>
                    <!-- <input type="text" class="common-input lawyer-input" placeholder="*必填" v-model="timeArr[i+1].Payment_Time"/> -->
                    <input type="text" class="common-input lawyer-input" placeholder="*必填" v-model="timeArr[i+1].Charge_Amount"/>
                    <input type="text" class="common-input lawyer-input" placeholder="*必填" v-model="timeArr[i+1].Describe"/>
                       <div class="input-icon" @click="deleteLine(i,payDate,timeArr)"><i class="el-icon-remove"></i></div>
                    </div>
                   </div>  
                    <div class="add-icon flex" @click="addPayDate()"><i class="el-icon-circle-plus"></i><p>添加</p></div>
                 </div>
                </div>
                 

                 <div class="add-Pay add-job" v-show="costId == 15">

                    <div class="add-Pay-index flex">
                    <div class="add-Pay-index-child">
                        <div class="flex">
                            <p class="title">付款日期</p>
                            <p class="title">收费金额</p>
                            <p class="title">描述</p>
                            <p class="input-icon"></p>
                        </div>
                        <div class="flex">
                        <!-- <input type="text" class="common-input lawyer-input" placeholder="请输入" v-model="timeArr[0].dateName"/> -->
                        <el-date-picker
                            v-model="timeArr[0].dateName"
                            type="date"
                            value-format="yyyy-MM-dd"
                            placeholder="选择日期时间">
                            </el-date-picker> 
                        <input type="text" class="common-input lawyer-input" placeholder="*必填(金额为数字)" v-model="timeArr[0].payCount" @keyup="inputChange(timeArr[0].payCount)"/>
                        <input type="text" class="common-input lawyer-input" placeholder="*必填" v-model="timeArr[0].describe"/>
                        <div class="input-icon"></div>
                        </div>
                        <div class="flex" v-for="(v,i) in payDate" :key="i">
                        <!-- <input type="text" class="common-input lawyer-input" placeholder="请输入" v-model="timeArr[i+1].dateName"/> -->
                        <el-date-picker
                            class="time_input"
                            v-model="timeArr[i+1].dateName" 
                            value-format="yyyy-MM-dd"
                                type="date"
                                placeholder="选择日期时间">
                            </el-date-picker>
                        <input type="text" class="common-input lawyer-input" placeholder="*必填(金额为数字)" v-model="timeArr[i+1].payCount"  @keyup="inputChange(timeArr[i+1].payCount)"/>
                        <input type="text" class="common-input lawyer-input" placeholder="*必填" v-model="timeArr[i+1].describe"/>
                        <div class="input-icon" @click="deleteLine(i,payDate,timeArr)"><i class="el-icon-remove"></i></div>
                        </div>
                    </div>  
                        <div class="add-icon flex" @click="addPayDate()"><i class="el-icon-circle-plus"></i><p>添加</p></div>
                    </div>


                    <div class="add-Pay-index flex" style="margin-top:30px;">
                    <div class="add-Pay-index-child">
                        <div class="flex">
                            <!-- <p class="title">风险金额</p>
                            <p class="title">基本金额</p> -->
                            <p class="title">风险达成条件</p>
                            <p class="input-icon"></p>
                        </div>
                        <div class="flex">
                        <!-- <input type="text" class="common-input lawyer-input" placeholder="请输入" v-model="riskArr[0].riskName"/>
                        <input type="text" class="common-input lawyer-input" placeholder="请输入" v-model="riskArr[0].riskCount"/> -->
                        <input type="text" class="common-input lawyer-input" placeholder="*必填" v-model="riskArr[0].riskCondition" style="width:700px"/>
                        <div class="input-icon"></div>
                        </div>
                        <div class="flex" v-for="(v,i) in riskAcount" :key="i">
                        <!-- <input type="text" class="common-input lawyer-input" placeholder="请输入" v-model="riskArr[i+1].riskName"/>
                        <input type="text" class="common-input lawyer-input" placeholder="请输入" v-model="riskArr[i+1].riskCount"/> -->
                        <input type="text" class="common-input lawyer-input" placeholder="*必填" v-model="riskArr[i+1].riskCondition" style="width:700px"/>
                        <div class="input-icon" @click="deleteLine(i,riskAcount,riskArr)"><i class="el-icon-remove"></i></div>
                        </div>
                    </div>  
                        <div class="add-icon flex" @click="addRiskAcount()"><i class="el-icon-circle-plus"></i><p>添加</p></div>
                    </div>


                </div>

                    
                 <div class="add-Pay add-job" v-show="costId == 10">
                    <div class="add-Pay-index flex">
                   <div class="add-Pay-index-child">
                    <div class="flex">
                        <!-- <p class="title">风险金额</p>
                        <p class="title">基本金额</p> -->
                        <p class="title">风险达成条件</p>
                         <p class="input-icon"></p>
                    </div>
                    <div class="flex">
                    <!-- <input type="text" class="common-input lawyer-input" placeholder="*必填" v-model="riskArr[0].riskName"/>
                    <input type="text" class="common-input lawyer-input" placeholder="*必填" v-model="riskArr[0].riskCount"/> -->
                    <input type="text" class="common-input lawyer-input" placeholder="*必填" v-model="riskArr[0].Risk_Achievement" style="width:700px"/>
                     <div class="input-icon"></div>
                    </div>
                    <div class="flex" v-for="(v,i) in riskAcount" :key="i">
                    <!-- <input type="text" class="common-input lawyer-input" placeholder="*必填" v-model="riskArr[i+1].riskName"/>
                    <input type="text" class="common-input lawyer-input" placeholder="*必填" v-model="riskArr[i+1].riskCount"/> -->
                    <input type="text" class="common-input lawyer-input" placeholder="*必填" v-model="riskArr[i+1].Risk_Achievement" style="width:700px"/>
                     <div class="input-icon" @click="deleteLine(i,riskAcount,riskArr)"><i class="el-icon-remove"></i></div>
                    </div>
                   </div>  
                    <div class="add-icon flex" @click="addRiskAcount()"><i class="el-icon-circle-plus"></i><p>添加</p></div>
                 </div>
              </div>
                
                 <div class="add-Pay add-job" v-show="costId == 8">
                    <div class="add-Pay-index flex">
                   <div class="add-Pay-index-child">
                    <div class="flex">
                        <p class="title">姓名</p>
                        <p class="title">职务</p>
                        <p class="title">费率</p>
                        <p class="input-icon"></p>
                    </div>
                    <div class="flex">
                    <!-- <input type="text" class="common-input lawyer-input" placeholder="*必填" v-model="nameJobArr[0].nameJobName"/> -->
                  <el-popover placement="bottom-start" width="200" trigger="click" v-model="nameJobArr[0].visible" >
                    <input type="text" slot="reference" class="common-input lawyer-input" placeholder="*必填" v-model="nameJobArr[0].nameJobName"  readonly="readonly">                      
                       <el-autocomplete
                        class="inline-input"
                        v-model="nameJobArr[0].nameJobName1"
                        :fetch-suggestions="querySearch" 
                        placeholder="*必填内容"
                         @select="handleSelectNameArr"
                        @blur="blurInputNameArr()"
                         prefix-icon="el-icon-search"
                      
                        > 
                        </el-autocomplete>
                    </el-popover>

                  <el-select v-model="nameJobArr[0].Rule_Id" placeholder="*请选择">
                      <el-option v-for="item in layerSelectArr" :key="item.Id" :label="item.Value" :value="item.Id"></el-option>
                  </el-select>                        
                    
                    <!-- <input type="text" class="common-input lawyer-input" placeholder="*必填" v-model="nameJobArr[0].nameJobJob"/> -->
                    <input type="text" class="common-input lawyer-input" placeholder="*必填" v-model="nameJobArr[0].Rate"/><span class="rmb">RMB/小时</span>
                     <div class="input-icon"></div>
                      
                    </div>
                    <div class="flex" v-for="(v,i) in nameJob" :key="i">
                    <!-- <input type="text" class="common-input lawyer-input" placeholder="*必填" v-model="nameJobArr[i+1].nameJobName"/> -->
                <el-popover placement="bottom-start" width="200" trigger="click" v-model="nameJobArr[i+1].visible" >
                    <input type="text" slot="reference" class="common-input lawyer-input" placeholder="*必填" v-model="nameJobArr[i+1].nameJobName"  readonly="readonly">                      
                       <el-autocomplete
                        class="inline-input"
                        v-model="nameJobArr[i+1].nameJobName1"
                        :fetch-suggestions="querySearch" 
                        placeholder="*必填内容"
                          @select="((item)=>handleSelect1NameArr(item,i))"
                        prefix-icon="el-icon-search"
                        @blur="blurInput1NameArr(i)"
                     
                        > 
                        </el-autocomplete>
                    </el-popover>
                    <!-- <input type="text" class="common-input lawyer-input" placeholder="*必填" v-model="nameJobArr[i+1].nameJobJob"/> -->
                    <el-select v-model="nameJobArr[i+1].Rule_Id" placeholder="*请选择">
                      <el-option v-for="item in layerSelectArr" :key="item.Id" :label="item.Value" :value="item.Id"></el-option>
                  </el-select>    
                    <input type="text" class="common-input lawyer-input" placeholder="*必填" v-model="nameJobArr[i+1].Rate"/><span class="rmb">RMB/小时</span>
                    <div class="input-icon" @click="deleteLine(i,nameJob,nameJobArr)"><i class="el-icon-remove"></i></div>
                    </div>
                   </div>  
                    <div class="add-icon flex" @click="addNameJob()"><i class="el-icon-circle-plus"></i><p>添加</p></div>
                 </div>
              </div>

               <div class="add-method flex">
                     <div class="add-method-index flex">
                    <p>合同类型</p>
                     <div class="select-input">
                     <el-select v-model="Source_Contract" placeholder="*请选择">
                         <el-option v-for="item in fileTypeArr" :key="item.Id" :label="item.value" :value="item.Id"></el-option>
                    </el-select>                           
                     </div>
                       <button class="shangchuan_btn"  v-show="Source_Contract == 2 &&  firstSource_Contract == 2" @click="picUpload1()">重新上传</button> 
                       <button class="shangchuan_btn"  v-show="Source_Contract == 2 &&  firstSource_Contract == 2" @click="dialogFormVisible = true">预览</button>
                        <button class="shangchuan_btn" v-show="Source_Contract == 2 && firstSource_Contract == 1" @click="picUpload()">上传</button> 
                    

                       <!-- <button class="shangchuan_btn" v-show="Source_Contract == 2" @click="picUpload()">上传</button> -->
                       <!-- <button class="btn btn1" @click="dialogFormVisible = true">预览合同</button> -->
                     </div>
                     </div> 
                
                <div class="end-btn flex">
                     <button class="btn btn2" @click="updateAddAll()" :disabled='disabled'>提交修改</button>
                </div>
                 <el-dialog  :visible.sync="dialogFormVisible" :modal-append-to-body='false' :modal='false' width="1000px">
                        <iframe src='http://file.keking.cn/onlinePreview?url=http://haoren.gzbigbang.cn/cyx.docx' width='100%' height='1000px' frameborder='1'>
                        </iframe>
                </el-dialog>
             </div>
             
               <!-- 对话框 -->
     <el-dialog  :visible.sync="dialogFormVisible1" :modal-append-to-body='false' :modal='false' top="300px" width="600px">
        <div class="dialogFormVisible flex">
          <div class="dialogFormVisivleInput flex">
              <p>文档名称</p><div class="dialogFormVisivleInput_right"><input type="text" class="common-input" v-model="fileName" readonly></div>
          </div>
           <div class="dialogFormVisivleFile flex">
                  <el-upload
                    class="upload-demo"
                    drag
                    action="/yongxu/Base/uploadRawFile"
                    :data='nameData'
                    :on-success="successFile1"
                    :on-progress="progressFile1"
                    :before-upload="beforeFile1"
                    :on-error="errorFile1"
                    multiple>
                    <i class="el-icon-upload"></i>
                    <div class="el-upload__text">将文件拖到此处，或<em>点击上传</em></div>
                  </el-upload>
          </div>
          
      </div>
  
   <div slot="title" class="dialog-title">
        <div class="dialogFormVisivleHeader_left flex"><p>案件添加</p>/<p>客户合同</p></div>
  </div>
  <div slot="footer" class="dialog-footer">
    <div class="dialogFormVisivleFooter flex">
    <!-- <el-button type="primary"  @click="saveDoc()">保存</el-button> -->
    </div>
  </div>
</el-dialog>

 <el-dialog  :visible.sync="dialogFormVisible2" :modal-append-to-body='false' :modal='false' top="300px" width="600px">
      <div class="dialogFormVisible flex">
          <div class="dialogFormVisivleInput flex">
              <p>文档名称</p><div class="dialogFormVisivleInput_right"><input type="text" class="common-input" v-model="fileName" readonly></div>
          </div>
           <div class="dialogFormVisivleFile flex">
              <!-- <div class="dialogFormVisivleFile1">
                 <img-inputer v-model="imgFile" theme="light" size="large" :on-change="chooseImg" type="file" accept="image/png,image/gif,image/jpeg" placeholder="将文件拖到此处，或点击上传,只能上传jpg/png文件，且不超过500kb"/>  
              </div> -->
                <el-upload
                    ref="upload"
                    class="upload-demo"
                    drag
                    action="/yongxu/Base/uploadRawFile"
                    :data='nameData'
                    :on-success="successFile"
                    :on-progress="progressFile"
                    :before-upload="beforeFile"
                    :on-error="errorFile"
                    :limit="1"
                    multiple>
                    <i class="el-icon-upload"></i>
                    <div class="el-upload__text">将文件拖到此处，或<em>点击上传</em></div>
                    
                  </el-upload>
          </div>
          
      </div>
  
   <div slot="title" class="dialog-title">
        <div class="dialogFormVisivleHeader_left flex"><p>案件文书</p>/<p>我的文档</p>/<p>新建文档</p></div>
  </div>
  <div slot="footer" class="dialog-footer">
    <div class="dialogFormVisivleFooter flex">
    <!-- <el-button type="primary" @click="fileUpload()">上传</el-button> -->
    <el-button type="primary" @click="saveDoc()">保存</el-button>
    </div>
  </div>
</el-dialog>
 <!-- 富文本编译器 -->
              <el-dialog  :visible.sync="dialogFormVisible3" :modal-append-to-body='false' :modal='false' top="300px" width="490px">
        <div class="dialogFormVisible flex">
          <!-- <div class="dialogFormVisivleInput flex">
              <p>服务内容</p><div class="dialogFormVisivleInput_right"><input type="text" class="common-input" v-model="fileName" readonly></div>
          </div> -->
          <quill-editor v-model="Service_Content" ref="myQuillEditor"></quill-editor>
          
      </div>
  
   <div slot="title" class="dialog-title">
        <div class="dialogFormVisivleHeader_left flex"><p>案件添加</p>/<p>服务内容</p></div>
  </div>
  <div slot="footer" class="dialog-footer">
    <div class="dialogFormVisivleFooter flex">
    <!-- <el-button type="primary"  @click="saveDoc()">保存</el-button> -->
    </div>
  </div>
</el-dialog>
    </div>
</template>
<script>
import qs from 'qs';
import caseWord from './caseWord'
import { constants } from 'zlib';
import { provinceAndCityData, regionData, provinceAndCityDataPlus, regionDataPlus, CodeToText, TextToCode } from 'element-china-area-data'
export default {
    data(){
        return{
            disabled:false,
            //案由ID
            Cause_Id:'',
             /**客户类型 */
            // customTypeArr:[
            //     {Id:3,Value:'个人'},
            //      {Id:4,Value:'企业'}
            // ],
            restaurants: [],
            state1: false,
            /**搜索律师 */
            searchLaywer:'',
            /**律师姓名数组 */
            LawyerNameArr:[],
            visible1:false,
            /**是否常年客户 */
            // isValueArr:[
            //     {Id:1,Value:'是'},{Id:2,Value:'否'},
            // ],
            // isValue:'',
            // isValue:'',
            /**获取案由下拉 */
            CaseResonArr:[],
            CaseResonArr1:[],
            /**选择客户类型 */
            identity:'',
            // cardNo:'',
            /**一二级菜单案件类型 */
            optionMenu:[],
            optionChildMenu:[],
            Casevalue1:'',
            Casevalue:'',
            selectOneId:'',
            //对方当事人
            oppositePart:'',
            //受理机关
            compony:'',

            JobListValue:'',
            JobListArr:[],
            // suoshuValue:1,
            // suoshuhangyeArr:[],
            // customValue:3,
            costValue:'',
            costId:'',
            customId:0,
            // visible: false,
            textarea:'',
           
            userNameC:'',
            userNameE:'',
            // province:'',
            // address:'',
            // tel:'',

            caseValue:'',
            caseValue2:'',
            caseName:'',
            caseWhy:'',
            caseWhy1:'',
            textarea:'',

            laywerName:'',
            laywerJob:'',
            partyName:'',
            partyJob:'',

            dateName:'',
            payCount:'',
            describe:'',


            riskName:'',
            riskCount:'',
            riskCondition:'',

            nameJobName:'',
            nameJobJob:'',
            nameJobRate:'',


            text:'收起',
            showNum:0,
            arr:[],
            userInfo:[],
            PartyInfo:[],
            payDate:[],
            riskAcount:[],
            nameJob:[],

            options: [
                 {value: '1',label: '黄金糕'}
            ],
            value: '1',
            value1: '1',
            // value2: '',
            // 案件律师信息input-model
            inputArr:[
            
            ],
            // 当事人信息input-model
            input1Arr:[
          
            ],
            partyJobSelectArr:[
                {Id:1,Value:'当事人'}, {Id:3,Value:'关联方'}
            ],//当事人类型下拉
            // 付款方式之时间input-model
            timeArr:[
           
            ],
            // 付款方式之风险input-model
            riskArr:[
            
            ],
             // 付款方式之费率input-model
            nameJobArr:[
                
            ],
            //对方当事人
            oppositeParty:'',
            oppositePartyArr:[],
            //数据检索
            // search:'',
            // list:[
            //     // {Customer_Name_Zh:'风老大',Contact_Party:'15696518682',Id:'1'},
            //     // {Customer_Name_Zh:'陈老二',Contact_Party:'1569515845',Id:'2'},
            //     // {Customer_Name_Zh:'刘骜三',Contact_Party:'1536852565',Id:'3'},
            //     // {Customer_Name_Zh:'马云',Contact_Party:'1569653256',Id:'4'},
            //     // {Customer_Name_Zh:'敖牛恩',Contact_Party:'1458541236',Id:'5'},
            // ] ,
           dialogFormVisible:false,
           costWay:[],
            //律师下拉
            layerSelectArr:[],
            addData:{
                name:'永旭',
                laywerName:'广州金鹏律师事务所'
            },
            custom_Id:'',
            Customer_Type:'',//客户类型
            Case_Id:'',//案件Id
            newInputArr:{},
            Service_Content:'',
            fileTypeArr:[{value:'律所合同',Id:1},{value:'其他合同',Id:2}],
            fileType:1,
            Source_Contract:'',
            firstSource_Contract:'',
            code:'',
            fileName:'',
            nameData:{
                 File_Name:'',
            },
            updateId:'',
            File_Name:'',
            fileName1:'',
            Suffix_Name:'',
            size:'',
            dialogFormVisible1:false,
            dialogFormVisible2:false,
            dialogFormVisible3:false,
             //富文本
            editorOption:{
                modules:{
                  
                },
                placeholder:'选填',
                theme:'snow'
            },
            biaodie:'',
            options: regionData,
            // selectedOptions:[],

            //-------------------------------------------*******************客户基本信息
            customerList:[
                {
                    customValue:3,//客户类型
                    customTypeArr:'',
                    search:'',//客户名称
                    list:[
                        // {Customer_Name_Zh:'风老大',Contact_Party:'15696518682',Id:'1'},
                        // {Customer_Name_Zh:'陈老二',Contact_Party:'1569515845',Id:'2'},
                        // {Customer_Name_Zh:'刘骜三',Contact_Party:'1536852565',Id:'3'},
                        // {Customer_Name_Zh:'马云',Contact_Party:'1569653256',Id:'4'},
                        // {Customer_Name_Zh:'敖牛恩',Contact_Party:'1458541236',Id:'5'},
                    ] ,
                    cardNo:'', //身份证号码或纳税人编号
                    visible: false,
                    selectedOptions: [],    //省市区
                    suoshuValue:'',         //所属行业
                    suoshuhangyeArr:[],
                    value2: '',             //职务
                    City:'',
                    tel:'', //联系电话
                    isValue:'',//常年客户值
                    /**是否常年客户 */
                    isValueArr:[
                        {Id:1,Value:'是'},{Id:2,Value:'否'},
                    ],
                    address:'',     //详细地址
                    province:'',    //省市区字符串
                }
            ],
            
            //-------------------------------------------*******************客户基本信息end

        }
          
        
    },
    inject:["reload"],
    methods:{
         getCustomerList(){
            this.$http.get('/yongxu/Customer/Set_Dropdown').then((res)=>{
               // console.log(res)
                    this.customerList[0].customTypeArr = res.data.category
            })
        },
           openEditor(){
            this.dialogFormVisible3 = true
        },
        deleteLine(i,arr,arr1){
            arr.splice(i,1)
            arr1.splice(i+1,1)
        },
        pushUserInfo(){
            this.userInfo.push(1)
           // this.inputArr.push({laywerName:'',laywerJob:'',visible:false,laywerName1:'',Id:''})  
            this.inputArr.push({laywerName:'',visible:false,laywerJob:'',laywerName1:'',Case_Rule_Id:'',Lawyer_Id:''})

            //console.log(this.inputArr)
        },
        pushPartyInfo(){
            this.PartyInfo.push(1)
            this.input1Arr.push({partyName:''})

        },
        addPayDate(){
            this.payDate.push(1)
            this.timeArr.push({describe:'',payCount:'',dateName:'',Payment_Time:'',Charge_Amount:'',Describe:''})  
        },
         addRiskAcount(){
            this.riskAcount.push(1)
            this.riskArr.push({riskCondition:'',Risk_Achievement:''})
        },
         addNameJob(){
            this.nameJob.push(1)
            this.nameJobArr.push({nameJobRate:'',Rate:'',visible:false,nameJobName1:'',nameJobName:'',nameJobJob:'',Lawyer_Id:'',Rule_Id:''})

        },
        closeBox(){
           this.$router.push('/index/caseIndex')
        },
        updateAddAll(){
            if(this.checkData() == false){
                return false
            }
            var addJson={}
            if(this.costValue == ''||this.costValue == null){
                 this.$message({
                    message:'*请选择收费方式',
                    type:'warning'
                });
                return false
            }
             if(this.value2===''){
                    this.value2='无'
              }
            if(this.oppositeParty ===''){
                this.oppositeParty='无'
              }
            if(this.province===''|| this.province=='无'){
                this.province = '无'
            }
             if(this.compony === ''){
                this.compony = '无'
            }
            if(this.costValue == 8){
            addJson = {
              'User_Id':localStorage.getItem('userId'),//登录人Id
              'Customer_Id':this.custom_Id,//客户Id
              'Case_Id':this.Case_Id,//案件Id
              'Chinese_Name':this.search,//客户名称
             
              'City':this.province,//省市
              'Detailed_Address':this.address,//详细地址
              'Contact_Party':this.tel,//联系方式
              'Customer_Type_Id':this.customValue,//客户类别Id
              'industry_Id':this.suoshuValue, //行业ID
              'Position':this.value2,//职业
              'Identification':this.isValue,//是否常年
              'Customer_Number':this.cardNo,//客户编号

              'Receiving_Organ':this.compony,//案件受理机关
            //   'Party_Name':this.oppositeParty,//对方当事人
             'oppositePart':this.input1Arr,//对方当事人
              'Cause_Id':this.caseWhy1,//案由Id

            // 'caseValue':this.caseValue,
              'Case_Type':this.caseValue2,//二级案件类别
              'Case_Name':this.caseName,//案件名称
            //   'caseWay':this.caseWay,
              'Case_Introduction':this.textarea,//案件详情
              'Laywer_Arr':this.inputArr,//律师数组
            //   'Party_Arr':this.input1Arr,//当事人数组
                //服务内容
                'Service_Content':this.Service_Content,
                  'Source_Contract':this.Source_Contract,
                  //标的额
                  'Target':this.biaodie,
                  
             //合同
                'File_Name':this.File_Name,
                'Suffix_Name':this.Suffix_Name,
                'fileName':this.fileName1,
                'size':this.size,


              "Charging_Method":this.costValue,//收费方式id
              'Time_Arr':this.nameJobArr,//费率数组
              'sign':1
              
                }
          }
            
            if(this.costValue == 9){
  addJson = {
              'User_Id':localStorage.getItem('userId'),//登录人Id
              'Customer_Id':this.custom_Id,//客户Id
              'Case_Id':this.Case_Id,//案件Id
              'Chinese_Name':this.search,//客户名称
            
              'City':this.province,//省市
              'Detailed_Address':this.address,//详细地址
              'Contact_Party':this.tel,//联系方式
              'Customer_Type_Id':this.customValue,//客户类别Id
              'industry_Id':this.suoshuValue, //行业ID
              'Position':this.value2,//职业
              'Identification':this.isValue,//是否常年
              'Customer_Number':this.cardNo,//客户编号

              'Receiving_Organ':this.compony,//案件受理机关
            //   'Party_Name':this.oppositeParty,//对方当事人
             'oppositePart':this.input1Arr,//对方当事人
              'Cause_Id':this.caseWhy1,//案由Id

    //服务内容
                'Service_Content':this.Service_Content,
                  'Source_Contract':this.Source_Contract,
                    //标的额
                  'Target':this.biaodie,
             //合同
                 'File_Name':this.File_Name,
                'Suffix_Name':this.Suffix_Name,
                'fileName':this.fileName1,
                'size':this.size,

            // 'caseValue':this.caseValue,
              'Case_Type':this.caseValue2,//二级案件类别
              'Case_Name':this.caseName,//案件名称
            //   'caseWay':this.caseWay,
              'Case_Introduction':this.textarea,//案件详情
              'Laywer_Arr':this.inputArr,//律师数组
            //   'Party_Arr':this.input1Arr,//当事人数组

              "Charging_Method":this.costValue,//收费方式id
              'Fixed_Arr':this.timeArr,//定额
              'sign':1
            }
            }
            if(this.costValue == 10){
    addJson = {
                  'User_Id':localStorage.getItem('userId'),//登录人Id
              'Customer_Id':this.custom_Id,//客户Id
              'Case_Id':this.Case_Id,//案件Id
              'Chinese_Name':this.search,//客户名称
            
              'City':this.province,//省市
              'Detailed_Address':this.address,//详细地址
              'Contact_Party':this.tel,//联系方式
              'Customer_Type_Id':this.customValue,//客户类别Id
              'industry_Id':this.suoshuValue, //行业ID
              'Position':this.value2,//职业
              'Identification':this.isValue,//是否常年
              'Customer_Number':this.cardNo,//客户编号

              'Receiving_Organ':this.compony,//案件受理机关
            //   'Party_Name':this.oppositeParty,//对方当事人
             'oppositePart':this.input1Arr,//对方当事人
              'Cause_Id':this.caseWhy1,//案由Id
                //服务内容
                'Service_Content':this.Service_Content,
                  'Source_Contract':this.Source_Contract,
                    //标的额
                  'Target':this.biaodie,
            //合同
                 'File_Name':this.File_Name,
                'Suffix_Name':this.Suffix_Name,
                'fileName':this.fileName1,
                'size':this.size,

            // 'caseValue':this.caseValue,
              'Case_Type':this.caseValue2,//二级案件类别
              'Case_Name':this.caseName,//案件名称
            //   'caseWay':this.caseWay,
              'Case_Introduction':this.textarea,//案件详情
              'Laywer_Arr':this.inputArr,//律师数组
            //   'Party_Arr':this.input1Arr,//当事人数组

              "Charging_Method":this.costValue,//收费方式id 
              'Risk_Arr':this.riskArr, //风险
              'sign':1
            }
            }
            if(this.costValue == 15){
    addJson = {
              'User_Id':localStorage.getItem('userId'),//登录人Id
              'Customer_Id':this.custom_Id,//客户Id
              'Case_Id':this.Case_Id,//案件Id
              'Chinese_Name':this.search,//客户名称
            
              'City':this.province,//省市
              'Detailed_Address':this.address,//详细地址
              'Contact_Party':this.tel,//联系方式
              'Customer_Type_Id':this.customValue,//客户类别Id
              'industry_Id':this.suoshuValue, //行业ID
              'Position':this.value2,//职业
              'Identification':this.isValue,//是否常年
              'Customer_Number':this.cardNo,//客户编号

              'Receiving_Organ':this.compony,//案件受理机关
            //   'Party_Name':this.oppositeParty,//对方当事人
             'oppositePart':this.input1Arr,//对方当事人
              'Cause_Id':this.caseWhy1,//案由Id
                //服务内容
                'Service_Content':this.Service_Content,
                  'Source_Contract':this.Source_Contract,
                    //标的额
                  'Target':this.biaodie,
            //合同
                 'File_Name':this.File_Name,
                'Suffix_Name':this.Suffix_Name,
                'fileName':this.fileName1,
                'size':this.size,

            // 'caseValue':this.caseValue,
              'Case_Type':this.caseValue2,//二级案件类别
              'Case_Name':this.caseName,//案件名称
            //   'caseWay':this.caseWay,
              'Case_Introduction':this.textarea,//案件详情
              'Laywer_Arr':this.inputArr,//律师数组
            //   'Party_Arr':this.input1Arr,//当事人数组

              "Charging_Method":this.costValue,//收费方式id 
              'Risk_Arr':this.riskArr, //风险
              'Fixed_Arr':this.timeArr,//定额
              'sign':1
            }
            }
        addJson = JSON.stringify(addJson)
        //console.log(addJson)
        //console.log(JSON.stringify(addJson))
        //return false
        this.disabled = true
        this.$http.post('/yongxu/Index/Administrator_Upd_Case',{
                map:addJson
            }).then((res)=>{
                 //console.log(res)
                if(res.data == true){
                
                this.$message({
                    message:'更新成功',
                    type:'success'
                });
                 this.disabled = false
                this.$router.push('/index/caseIndex')
                return false
                }else{
                    this.$message({
                    message:'更新失败',
                    type:'warning'
                });
                  this.disabled = false
                return false
                }
               
            })
        },
    
        /**验证提交表单 */
        checkData(){
            console.log(this.customerList)
            this.customerList.forEach(e => {
                if(e.search===""||e.search==null){
                    this.$message({
                        message:'客户名称不能为空',
                        type:'warning'
                    });
                    this.$notify.error({
                        title: '错误',
                        message: '您尚未输入客户名称，请输入后重试'
                    });
                    return false
                }
                if(e.customValue===""||e.customValue==null){
                    this.$message({
                        message:'客户类型不能为空',
                        type:'warning'
                    });
                    this.$notify.error({
                    title: '错误',
                    message: '您尚未选择客户类型，请选择后重试'
                    });
                    return false
                }
            });

            //   if(this.search===""||this.search==null){
               
            //     this.$message({
            //         message:'客户名称不能为空',
            //         type:'warning'
            //     });
            //    this.$notify.error({
            //     title: '错误',
            //     message: '您尚未输入客户名称，请输入后重试'
            //     });
            //     return false
            // }

            
             
            // if(this.customValue ==3 || this.customValue ==14){
            //     // var reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/; 
            //     if(this.cardNo == '' || this.cardNo==null) 
            //     { 
            //          this.$message({
            //             message:'身份证信息不能为空',
            //              type:'warning'
            //          });
            //          this.$notify.error({
            //             title: '错误',
            //             message: '您尚未输入身份证信息，请输入后重试'
            //             });
            //            return false  
            //     }
            // }  
            this.customerList.forEach(e => {
                if(e.customValue !=3 && e.customValue !=14){
                    if(e.cardNo === '' || e.cardNo == null) {
                        this.$message({
                            message:'纳税人编号不能为空',
                            type:'warning'
                        });
                        this.$notify.error({
                            title: '错误',
                            message: '您尚未输入纳税人编号，请输入后重试'
                        });
                        return false 
                    }
                }
                if(e.suoshuValue===""||e.suoshuValue===null){
                    this.$message({
                        message:'*请选择所属行业',
                        type:'warning'
                    });
                    this.$notify.error({
                        title: '错误',
                        message: '您尚未选择所属行业，请选择后重试'
                    });
                    return false
                }
            });

            // if(this.customValue !=3 && this.customValue !=14){
            //     if(this.cardNo === '' || this.cardNo == null) 
            //     { 
            //          this.$message({
            //             message:'纳税人编号不能为空',
            //              type:'warning'
            //          });
            //          this.$notify.error({
            //             title: '错误',
            //             message: '您尚未输入纳税人编号，请输入后重试'
            //             });
            //            return false  
            //     }
            // if(this.suoshuValue===""||this.suoshuValue===null){
            //     this.$message({
            //         message:'*请选择所属行业',
            //         type:'warning'
            //     });
            //     this.$notify.error({
            //     title: '错误',
            //     message: '您尚未选择所属行业，请选择后重试'
            //     });
            //     return false
            // }
            // //    if(this.value2==""||this.value2==null){
            // //     this.$message({
            // //         message:'职务不能为空',
            // //         type:'warning'
            // //     });
            // //     return false
            // // }
            // }
            
            // if(this.province==""||this.province==null){
            //     this.$message({
            //         message:'省市区信息不能为空',
            //         type:'warning'
            //     });
            //     return false
            // }
            this.customerList.forEach(e => {
                if(e.address===""||e.address==null){ 
                    this.$message({
                        message:'详细地址不能为空',
                        type:'warning'
                    });
                    this.$notify.error({
                            title: '错误',
                            message: '您尚未输入详细地址，请输入后重试'
                            });
                    return false
                }
            });
            this.customerList.forEach(e => {
                if(e.tel===""||e.tel==null){
                    this.$message({
                        message:'联系电话不能为空',
                        type:'warning'
                    });
                    this.$notify.error({
                            title: '错误',
                            message: '您尚未输入联系电话，请输入后重试'
                            });
                    return false
                }
            });

            this.customerList.forEach(e => {
                if (e.tel.length<2||e.tel.length>30) {
                    this.$message({
                        message:'联系电话格式不正确',
                        type:'warning'
                    });
                    this.$notify.error({
                            title: '错误',
                            message: '您输入的联系电话格式不正确，请重新输入后重试'
                            });
                    return false;
                } 
                if(e.isValue===""||e.isValue==null){
                    this.$message({
                        message:'*请选择是否常年客户',
                        type:'warning'
                    });
                    this.$notify.error({
                            title: '错误',
                            message: '您尚未选择是否是常年客户，请选择后重试'
                            });
                    return false
                }
            });
             
          
             
            //var myreg = /^((0\d{2,3}-\d{7,8})|(1[34578]\d{9}))$/;
            

            if(this.caseValue===""||this.caseValue==null || this.caseValue2==""||this.caseValue2 ==null ){
                this.$message({
                    message:'*请选择案件类型',
                    type:'warning'
                });
                 this.$notify.error({
                        title: '错误',
                        message: '您尚未选择案件类型，请选择后重试'
                        });
                return false
            }
            if(this.caseName===""||this.caseName==null){
                this.$message({
                    message:'案件名称不能为空',
                    type:'warning'
                });
                 this.$notify.error({
                        title: '错误',
                        message: '您尚未输入案件名称，请输入后重试'
                        });
                return false
            }
           if(this.caseWhy1===""||this.caseWhy1==null){
                this.$message({
                    message:'*请选择案由',
                    type:'warning'
                });
                 this.$notify.error({
                        title: '错误',
                        message: '您尚未选择案由类型，请选择后重试'
                        });
                return false
            }
            //  if(this.compony==""||this.compony==null){
            //     this.$message({
            //         message:'请填写受理机关',
            //         type:'warning'
            //     });
            //     return false
            // }
            //  if(this.textarea==""||this.textarea==null){
            //     this.$message({
            //         message:'请填写案情简介',
            //         type:'warning'
            //     });
            //     return false
            // }

            //   if(this.caseValue == 4 || this.caseValue == 8 || this.caseValue == 11){
            //        if(this.oppositeParty==""||this.oppositeParty==null){
            //             this.$message({
            //                 message:'对方当事人不能为空',
            //                 type:'warning'
            //             });
            //              this.$notify.error({
            //             title: '错误',
            //             message: '按键类型为民事、仲裁、行政时，对方当事人必填'
            //             });
            //             return false
            //         }
            //   }  
             if(this.caseValue == 4 || this.caseValue == 8 || this.caseValue == 11 ||this.input1Arr.length>1){
                     var arrParty=[]
                    for(var i in this.input1Arr){
                        arrParty.push(this.input1Arr[i].partyName)
                          
                    }
                    console.log(this.input1Arr)
                  console.log(arrParty)
                    if (arrParty.indexOf('') != -1){
                        this.$message({
                            message:'对方当事人不能为空',
                            type:'warning'
                        });
                         this.$notify.error({
                        title: '错误',
                        message: '按键类型为民事、仲裁、行政时，对方当事人必填'
                        });
                        return false
                    }
              }
            var arr=[]
            for(var i in this.inputArr){
                arr.push(this.inputArr[i].Lawyer_Id)
            }
            console.log(this.inputArr)
            //console.log(arr)
            if (arr.indexOf('') != -1){
                 this.$message({
                    message:'*请选择律师姓名',
                    type:'warning'
                });
                 this.$notify.error({
                        title: '错误',
                        message: '您尚未选择律师姓名，请选择后重试'
                        });
                return false
            }
            var nary=arr.sort();
            console.log(nary)
            for(var i=0;i<arr.length;i++){
                if (nary[i]==nary[i+1]){
                  this.$message({
                    message:'律师数据重复请重新选择',
                    type:'warning'
                    });
                     this.$notify.error({
                        title: '错误',
                        message: '您选择的律师信息重复，请重新选择后重试'
                        });
                    return false
                }
            }


             var arrJob=[]
            for(var i in this.inputArr){
                arrJob.push(this.inputArr[i].laywerJob)
            }
            if (arrJob.indexOf('') != -1){
                 this.$message({
                    message:'*请选择律师职务',
                    type:'warning'
                });
                 this.$notify.error({
                        title: '错误',
                        message: '您尚未选择律师职务，请选择后重试'
                        });
                return false
            }
         
         var arrJob1=[]
            for(var i in this.inputArr){
                arrJob1.push(this.inputArr[i].laywerJob)
            }
            //console.log(arrJob1) //false
           if(arrJob1.indexOf(18) == -1){
                 this.$message({
                    message:'请至少填写一位主办律师',
                    type:'warning'
                });
                 this.$notify.error({
                        title: '错误',
                        message: '您选择的律师职务中不含主办律师，请选择一位为主办律师后重试'
                        });
                return false
            }
           var nary1=arrJob1.sort();
           console.log(nary1)
            for(var i=0;i<arrJob1.length;i++){
                if (nary1[i]==nary1[i+1] && nary1[i]==18 && nary1[i+1]==18){  
           
                    this.$message({
                    message:'最多一位主办律师',
                    type:'warning'
                });
                 this.$notify.error({
                        title: '错误',
                        message: '您选择的律师职务中含多位主办律师，请只选择一位为主办律师后重试'
                        });
                 return false
                }
            }
            //服务内容
            //   if(this.Service_Content==""||this.Service_Content==null){
            //     this.$message({
            //         message:'服务内容不能为空',
            //         type:'warning'
            //     });
            //     return false
            // }
             //标的额
            //     if(this.biaodie ==""||this.biaodie==null){
            //     this.$message({
            //         message:'服务内容不能为空',
            //         type:'warning'
            //     });
            //     return false
            // }
            
            // var arrParty=[]
            // for(var i in this.input1Arr){
            //     arrParty.push(this.input1Arr[i].partyName)
            // }
            // if (arrParty.indexOf('') != -1){
            //      this.$message({
            //         message:'当事人姓名不能为空',
            //         type:'warning'
            //     });
            //     return false
            // }

            // var arrPartyJob=[]
            // for(var i in this.input1Arr){
            //     arrPartyJob.push(this.input1Arr[i].partyJob)
            // }
            // if (arrPartyJob.indexOf('') != -1){
            //      this.$message({
            //         message:'*请选择当事人类型',
            //         type:'warning'
            //     });
            //     return false
            // }

              if(this.costValue===""||this.costValue==null){
                this.$message({
                    message:'*请选择收费方式',
                    type:'warning'
                });
                 this.$notify.error({
                        title: '错误',
                        message: '您尚未选择收费方式，请选择后重试'
                        });
                return false
            }
           
           if(this.costValue==8){

            var arrJobArr8=[]
            for(var i in this.nameJobArr){
                arrJobArr8.push(this.nameJobArr[i].nameJobName)
            }
            console.log(arrJobArr8)
            if (arrJobArr8.indexOf('') != -1){
                 this.$message({
                    message:'姓名不能为空',
                    type:'warning'
                });
                 this.$notify.error({
                        title: '错误',
                        message: '您尚未选择按时收费下的律师姓名，请选择后重试'
                        });
                return false
            }
            var nary=arrJobArr8.sort();
            for(var i=0;i<arrJobArr8.length;i++){
                if (nary[i]==nary[i+1]){
                  this.$message({
                    message:'律师数据重复请重新选择',
                    type:'warning'
                    });
                     this.$notify.error({
                        title: '错误',
                        message: '您选择的按时收费下的律师姓名重复，请重新选择后重试'
                        });
                    return false
                }
            }
        


            var arrJobArrJob8=[]
            for(var i in this.nameJobArr){
                arrJobArrJob8.push(this.nameJobArr[i].nameJobJob)
            }
            if (arrJobArrJob8.indexOf('') != -1){
                 this.$message({
                    message:'职务不能为空',
                    type:'warning'
                });
                 this.$notify.error({
                        title: '错误',
                        message: '您尚未选择按时收费下的律师职务，请选择后重试'
                        });
                return false
            }
             if(arrJobArrJob8.indexOf(18) == -1){
                 this.$message({
                    message:'请至少填写一位主办律师',
                    type:'warning'
                });
                 this.$notify.error({
                        title: '错误',
                        message: '您选择的按时收费下的律师职务中不含主办律师，请选择一位为主办律师后重试'
                        });
                return false
            }
            //
             var nary22 =arrJobArrJob8.sort();
            for(var i=0;i<arrJobArrJob8.length;i++){
                if (nary22[i]==nary22[i+1] && nary22[i]==18 && nary22[i+1]==18){  
                    this.$message({
                    message:'最多一位主办律师',
                    type:'warning'
                });
                 this.$notify.error({
                        title: '错误',
                        message: '您选择的按时收费下的律师职务中含多位主办律师，请只选择一位为主办律师后重试'
                        });
                 return false
                }
            }
            //

             var arrJobJobRate8=[]
            for(var i in this.nameJobArr){
                arrJobJobRate8.push(this.nameJobArr[i].nameJobRate)
            }
            if (arrJobJobRate8.indexOf('') != -1){
                 this.$message({
                    message:'费率不能为空',
                    type:'warning'
                });
                 this.$notify.error({
                        title: '错误',
                        message: '您尚未输入按时收费下的费率，请输入后重试(格式为阿拉伯数字或加小数点后两位)'
                        });
                return false
            }
        }

         if(this.costValue==9){
            var arr9=[]
            for(var i in this.timeArr){
                arr9.push(this.timeArr[i].dateName)
            }
            if (arr9.indexOf('') != -1){
                 this.$message({
                    message:'*请选择付款日期',
                    type:'warning'
                });
                   this.$notify.error({
                        title: '错误',
                        message: '您尚未选择定额收费下的付款日期，请选择后重试'
                        });
                return false
            }

            var arrMoney=[]
            var reg1 = /^\d+$|^\d*\.\d+$/g;
            var re=/^\d*\.{0,2}\d{0,2}$/;
            for(var i in this.timeArr){
                arrMoney.push(this.timeArr[i].payCount)
            }
            if (arrMoney.indexOf('') != -1){
                 this.$message({
                    message:'付款金额不能为空',
                    type:'warning'
                });
                  this.$notify.error({
                        title: '错误',
                        message: '您尚未输入定额收费下的付款金额，请输入后重试(格式为阿拉伯数字或加小数点后两位)'
                        });
                return false
            }
            console.log(arrMoney)
            for(var i = 0;i<arrMoney.length;i++){
                console.log(i)
                console.log(re.test(arrMoney[i]))
              
                if(!re.test(arrMoney[i])){
                    this.$message({
                        message:'付款金额格式为数字或加小数点后一位',
                        type:'warning'
                    });
                     this.$notify.error({
                        title: '错误',
                        message: '您输入的定额收费下的付款金额格式不正确，请重新输入后重试(格式为阿拉伯数字或加小数点后两位)'
                        });
                    return false
                    }
                }
              
            
             
         

        

             var arrdescribe=[]
            for(var i in this.timeArr){
                arrdescribe.push(this.timeArr[i].describe)
            }
            if (arrdescribe.indexOf('') != -1){
                 this.$message({
                    message:'请输入描述',
                    type:'warning'
                });
                 this.$notify.error({
                        title: '错误',
                        message: '您尚未输入定额收费下的的描述，请输入后重试'
                        });
                return false
            }
        }

    if(this.costValue==10){
            var arr10=[]
            for(var i in this.riskArr){
                arr10.push(this.riskArr[i].riskCondition)
            }
            if (arr10.indexOf('') != -1){
                 this.$message({
                    message:'请填写描述',
                    type:'warning'
                });
                  this.$notify.error({
                        title: '错误',
                        message: '您尚未输入风险收费下的的描述，请输入后重试'
                        });
                return false
            }
        }

          if(this.fileType==""||this.fileType==null){
                this.$message({
                    message:'*请选择合同类型',
                    type:'warning'
                });
                this.$notify.error({
                        title: '错误',
                        message: '您尚未选择合同类型，请选择后重试'
                        });
                return false
            }
          if(this.fileType==2){
            if(this.code != 200){
               this.$message({
                    message:'请先上传文件',
                    type:'warning'
                });
                  this.$notify.error({
                        title: '错误',
                        message: '您尚未上传文件合同，请上传后后重试'
                        });
                return false  
                }
            }
                return true
        },
        getAlreadyName(id,name){
            this.search = name
            if(id == '' || id== null){
                id =0
            }
            this.customId = id
            this.getCustomInfo()
            this.visible = false
        },
        /** */
        getAlreadyLayerName(){
            this.searchLaywer = name
            if(id == '' || id== null){
                id =0
            }

            this.visible1 = false
        },
        /*获取已存在客户列表*/ 
        getCustomSelect(){
            this.$http.get('/yongxu/Index/Get_All_Customers').then((res) => {
              
                this.list = JSON.parse(JSON.stringify(res.data.Name))
            })
        },
        getCustomFilter(){
             this.$http.get('/yongxu/Index/Get_Name_Customer',{params:{name:this.search}}).then((res) => {
                 this.list = res.data
                 //console.log(this.list)
            })
        },
        /**获取客户类型下拉 */
        getCustomType(){
              this.$http.get('/yongxu/Index/Get_All_Customers').then((res) => {
                   /**获取客户类型下拉 */
                //  this.customTypeArr = res.data.Types
                   /**获取所属行业下拉 */
                 this.suoshuhangyeArr = res.data.Industry
             })
        },
        /**获取职务下拉列表 */
        getJobList(){
             this.$http.get('/yongxu/Index/Get_Droplist').then((res) => {
                
                //  this.JobListArr = res.data.Post
                /**获取职务下拉列表 */
                 this.layerSelectArr = res.data.Post
                  /**获取案由下拉 */
                 // this.CaseResonArr = res.data.Summary
                   /**获取收费方式下拉 */
                     this.costWay = res.data.AllCharging
                     /**获取律师数据 */
                     this.LawyerNameArr =res.data.Lawyer
                      for (let i = 0; i < this.LawyerNameArr.length; i += 1) {
                        this.LawyerNameArr[i].value =  this.LawyerNameArr[i].Staff_Name;      
                        }
                     
             })
        },
          /**更改一级案由 */
        changeCaseReson(id){
            this.getCaseResonList1(id)
        },
        /**获取案由根据一级案件类型 */
        getCaseResonList(id){
             this.$http.get('/yongxu/Index/Get_Cause_Case',{params:{Id:id}}).then((res) => {
                 //console.log(res)
                 this.CaseResonArr=[]
                 this.CaseResonArr = res.data
                 this.getCaseResonList1(this.caseWhy)
             })
        },
             /**获取案由根据一级案由获取二级案由 */
        getCaseResonList1(id){
             this.$http.get('/yongxu/Index/Get_Two_Cause',{params:{Id:id}}).then((res) => {
                  this.CaseResonArr1=[]
                  this.CaseResonArr1 = res.data
             })
        },
        /**h获取案件类型1J */
         getSelectMenu(){
         this.$http.get('/yongxu/Index/GetBoxOne').then((res)=>{
           this.optionMenu = res.data
        })
      },
          /**h获取案件类型2J */
         getSelectMenuTwo(){
         this.$http.get('/yongxu/Index/GetBoxTwo',{params:{Id:this.caseValue}}).then((res)=>{
             //console.log(res)
           this.optionChildMenu = res.data
        })
      },
       getSelectChildeMenu(id){
         this.caseValue2= ''
         this.optionChildMenu = ''
         this.Casevalue1 =''
         //console.log(id)
         this.selectOneId = id
         this.caseWhy=''
         this.caseWhy1=''
         this.getCaseResonList(id)
         this.$http.get('/yongxu/Index/GetBoxTwo',{params:{Id:this.selectOneId}}).then((res)=>{
           this.optionChildMenu = res.data  
        })
      },
        changeCostWay(id){
            this.costId = id
              //console.log(this.costId)
            //console.log(this.cur)
        },
      
        changeId(){
                  this.customId = 0
                  this.userNameE=''
                  this.province=''
                  this.address = ''
                  this.tel=''
                  this.suoshuValue = 0
                  this.value2 = ''
                  this.customValue = ''
                  this.cardNo=''
                  this.isValue=''
        },

        getCustomInfo(){
            //console.log(this.custom_Id)
             this.$http.get('/yongxu/Index/Get_DetailsCustomer',{params:{Id:this.custom_Id}}).then((res)=>{ 
                  console.log(res)
                  this.userNameE=res.data.Customer_Name_En
                  this.province=res.data.City
                  if(res.data.City ==undefined || res.data.City=="" || res.data.City=="无"){
                            res.data.City == ""
                            this.selectedOptions = []
                  }else{
                  var length = arr.City.split('-').length
                      console.log(length)
                        if(length == 2){
                            var a = TextToCode[arr.City.split('-')[0]].code
                            var b = TextToCode[arr.City.split('-')[0]][arr.City.split('-')[1]].code
                             this.selectedOptions = [a,b]
                        }
                        else if(length==3){
                            var a = TextToCode[arr.City.split('-')[0]].code
                            var b = TextToCode[arr.City.split('-')[0]][arr.City.split('-')[1]].code
                            var c = TextToCode[arr.City.split('-')[0]][arr.City.split('-')[1]][arr.City.split('-')[2]].code
                            this.selectedOptions = [a,b,c]
                        }
                  }

               
                  this.address = res.data.Detailed_Address
                  this.tel=res.data.Contact_Party
                  this.suoshuValue = res.data.TradeId
                  this.value2 = res.data.Position
                  this.customValue = res.data.CustomerId
                  this.cardNo =res.data.Customer_Number
                 this.isValue=res.data.Identification
        })
           
        },
        /**改变客户类型 */
        changeCustomType(){
                this.customId = 0
                this.userNameE=''
                  this.province=''
                  this.address = ''
                  this.tel=''
                  this.suoshuValue = ''
                  this.value2 = ''
                //   this.search = ''
                  this.cardNo=''
                  this.isValue=''
        },
      /**律师姓名下拉查询 */
      querySearch(queryString, cb) {
          //console.log(this.LawyerNameArr)
        var restaurants =  this.LawyerNameArr
      
        // //console.log(restaurants)
        var results = queryString ? restaurants.filter(this.createFilter(queryString)) : restaurants;
        // 调用 callback 返回建议列表的数据
        cb(results);
      },
      createFilter(queryString) {
        return (restaurant) => {
          return (restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0);
        };
      },
     
     /**选择律师姓名 */
      handleSelect(item) {
           var arr=[]
          
           
            for(var i in this.inputArr){
                arr.push(this.inputArr[i].Lawyer_Id)
            }
            //console.log(item.Id)
             //console.log(arr)
           if (arr.indexOf(item.Id) != -1){
                 this.$message({
                    message:'律师姓名不能重复',
                    type:'warning'
                });
                return false
            }
        this.inputArr[0].laywerName=item.value
        this.inputArr[0].Id=item.Id
        this.inputArr[0].Lawyer_Id = item.Id              
        this.inputArr[0].visible=false
       
           
      },
      handleSelect1(item,i){
          //console.log(this.inputArr)
          //console.log(i)
          //console.log(item);
          var arr=[]
            for(var j in this.inputArr){
                arr.push(this.inputArr[j].Lawyer_Id)
            }
            //console.log(item.Id)
             //console.log(arr)
           if (arr.indexOf(item.Id) != -1){
                 this.$message({
                    message:'律师姓名不能重复',
                    type:'warning'
                });
                return false
            }
            //console.log(i+1)
           this.inputArr[i+1].laywerName=item.value
           this.inputArr[i+1].Id=item.Id     
           this.inputArr[i+1].Lawyer_Id = item.Id   
           this.inputArr[i+1].visible=false
           //console.log(this.inputArr)
    //         var arr =[]
    //     for(var i=0;i<this.inputArr.length;i++){
    //         arr.push(this.inputArr[i].laywerName)
    //     }
        
    //    this.LawyerNameArr.splice(arr.indexOf(item.value),1)
    //     //console.log(this.LawyerNameArr);
      },
      blurInput(){
         this.inputArr[0].laywerName1 = ''
      },
     blurInput1(i){
         this.inputArr[i+1].laywerName1 = ''
      },
       /**小时收费选择律师姓名 */
      handleSelectNameArr(item) {
        //console.log(item);
        this.nameJobArr[0].nameJobName=item.value
        this.nameJobArr[0].Lawyer_Id=item.Id 
        this.nameJobArr[0].Id=item.Id        
        this.nameJobArr[0].visible=false
        // const res = this.restaurants.filter((item) => { return item.value=== this.inputArr[0].laywerName;});
        ////console.log(res)
      },
      handleSelect1NameArr(item,i){
          //console.log(i)
          //console.log(item);
           this.nameJobArr[i+1].nameJobName=item.value

           this.nameJobArr[i+1].Lawyer_Id=item.Id 
           this.nameJobArr[i+1].Id=item.Id     
           this.nameJobArr[i+1].visible=false
      },
      blurInputNameArr(){
         this.nameJobArr[0].nameJobName1 = ''
      },
      blurInput1NameArr(i){
         this.nameJobArr[i+1].nameJobName1 = ''
      },
        getUpdateInfo(){
            //console.log(this.$route.params.id)
            this.$http.get('/yongxu/Index/Case_Details',{params:{
                Id:this.$route.params.id,
                Type_Id:this.$route.params.typeId
            }}).then((res)=>{
                console.log(res) 
                 // d对方当事人
                let arr=res.data.Get_Customer_Information
               
               this.caseValue = arr.One_Type_Id
                if(res.data.getOppositeparty.length == 0){
                    this.input1Arr.push({partyName:''})
                }else{
                    console.log(i)
                    for(var i in res.data.getOppositeparty){
                        console.log(res.data.getOppositeparty[i].Party_Name)
                        this.input1Arr.push({partyName:res.data.getOppositeparty[i].Party_Name})
                    }
                }
               
                let newInput1Arr =  this.input1Arr
                this.PartyInfo = newInput1Arr.slice(1)
                console.log(this.PartyInfo)
                console.log(this.input1Arr)
                // 客户信息d
                
                this.customerList = []
                for (let i = 0; i < res.data.Get_Customer_Information.length; i++) {
                    var length = arr[i].City.split('-').length
                    var selectedcity = []
                    if(length == 2){
                            var a = TextToCode[arr[i].City.split('-')[0]].code
                            var b = TextToCode[arr[i].City.split('-')[0]][arr[i].City.split('-')[1]].code
                            selectedcity = [a,b]
                        }
                        else if(length==3){
                            var a = TextToCode[arr[i].City.split('-')[0]].code
                            var b = TextToCode[arr[i].City.split('-')[0]][arr[i].City.split('-')[1]].code
                            var c = TextToCode[arr[i].City.split('-')[0]][arr[i].City.split('-')[1]][arr[i].City.split('-')[2]].code
                            selectedcity = [a,b,c]
                        }
                     this.customerList.push(
                        {
                            customTypeArr:arr[i].Customer_Type,
                            search:arr[i].Customer_Name_Zh,
                            customValue:arr[i].Customer_Type,
                            cardNo:arr[i].Customer_Number,
                            // selectedOptions:arr[i].City,
                            selectedOptions:selectedcity,
                            value2:arr[i].Position,
                            tel:arr[i].Customer_Number,
                            suoshuValue:arr[i].industry,
                            address:arr[i].Detailed_Address,
                            isValue:arr[i].perennial,
                        }
                    )
                    
                }
               

                // this.custom_Id = arr[0].Id
                //this.Customer_Name_Zh = arr.Customer_Name_Zh
                // this.Customer_Type= arr.Customer_Type
                // this.Contact_Party= arr.Contact_Party
                // this.Detailed_Address= arr.Detailed_Address
                // this.Position= arr.Position,
                // this.Customer_Name_En= arr.Customer_Name_En
                
                // this.industry= arr.industry
                // this.Customer_Name_Zh=arr.Customer_Name_Zh

                  
                  
                  
                  
                  
                  
                  

                

                   
                  //console.log(arr.City.split('-')[0])
                  
              
                //案件信息
                let caseInfo = res.data.Get_Case_Information
                this.Cause_Id = caseInfo.Cause_Id
                this.caseWhy = caseInfo.One_Cause_Id
                this.caseWhy1 = caseInfo.Cause_Id
                this.Cause_Action = caseInfo.Cause_Action
                this.Case_Name=caseInfo.Case_Name
                this.caseName = caseInfo.Case_Name
                this.Case_type=caseInfo.Case_type
                this.introduce = caseInfo.Case_Introduction
                this.textarea = caseInfo.Case_Introduction
                this.Case_Id = caseInfo.Id
                this.Service_Content = caseInfo.Service_Content
                this.Source_Contract = caseInfo.Source_Contract
                this.firstSource_Contract = caseInfo.Source_Contract
                this.biaodie = caseInfo.Target //标的额
                //受理机关
                this.Receiving_Organ=caseInfo.Receiving_Organ
                this.compony = caseInfo.Receiving_Organ
                
                this.Party_Name = caseInfo.Party_Name
                this.oppositeParty = caseInfo.Party_Name

                this.Type_Id = caseInfo.Type_Id
                this.caseValue = caseInfo.One_Type_Id
                this.caseValue2 = caseInfo.Two_Type_Id
                 this.getCaseResonList(this.caseValue)
                //案件律师信息
                this.layWerInfoArr = res.data.Get_Lawyer_Information
                var _self =this
                for(var i in _self.layWerInfoArr){
        _self.inputArr.push({laywerName:_self.layWerInfoArr[i].Staff_Name,visible:false,laywerJob:_self.layWerInfoArr[i].Case_Rule_Id,laywerName1:'',Case_Rule_Id:_self.layWerInfoArr[i].Case_Rule_Id,Lawyer_Id:_self.layWerInfoArr[i].Id})
                }    
                this.newInputArr = _self.inputArr 
                _self.userInfo = this.newInputArr.slice(1)
              
                //收费方式
                this.way = res.data.Value
                this.cur = res.data.Id
                this.costValue = res.data.Id
                this.costId  = this.costValue
                if(this.costId == 8){
                //小时收费
                this.ChargeInfoArr = res.data.Charge
                  for(var i in this.ChargeInfoArr){
                    this.nameJobArr.push({nameJobRate:this.ChargeInfoArr[i].Rate,Rate:this.ChargeInfoArr[i].Rate,visible:false,nameJobName1:'',nameJobName:this.ChargeInfoArr[i].Staff_Name,nameJobJob:this.ChargeInfoArr[i].Staff_Id,Lawyer_Id:this.ChargeInfoArr[i].Staff_Id,Rule_Id:this.ChargeInfoArr[i].Rule_Id})
                }
                this.timeArr=[{describe:'',payCount:'',dateName:'',Payment_Time:'',Charge_Amount:'',Describe:''}]
                this.riskArr=[{riskCondition:'',Risk_Achievement:''}]

                this.riskAcount = this.riskArr.slice(1)
                this.nameJob = this.nameJobArr.slice(1)
                this.payDate = this.timeArr.slice(1)

                 
                }
                if(this.costId == 9){
                   
                //定额收费
                this.ChargeInfoArr = res.data.Charge
                //console.log(this.ChargeInfoArr)
                 for(var i in this.ChargeInfoArr){
                    this.timeArr.push({describe:this.ChargeInfoArr[i].Describe,payCount:this.ChargeInfoArr[i].Charge_Amount,dateName:this.ChargeInfoArr[i].Payment_Time,Payment_Time:this.ChargeInfoArr[i].Payment_Time,Charge_Amount:this.ChargeInfoArr[i].Charge_Amount,Describe:this.ChargeInfoArr[i].Describe})
                }
                this.riskArr=[{riskCondition:'',Risk_Achievement:''}]
                this.nameJobArr=[{nameJobRate:'',Rate:'',visible:false,nameJobName1:'',nameJobName:'',nameJobJob:'',Lawyer_Id:'',Rule_Id:''}]
                
                 this.riskAcount = this.riskArr.slice(1)
                this.nameJob = this.nameJobArr.slice(1)
                this.payDate = this.timeArr.slice(1)
                //console.log(this.payDate)
                }

                if(this.costId == 10){
                this.ChargeInfoArr = res.data.Charge
                //console.log(this.ChargeInfoArr)
                  for(var i in this.ChargeInfoArr){
                    this.riskArr.push({riskCondition:this.ChargeInfoArr[i].Risk_Achievement,Risk_Achievement:this.ChargeInfoArr[i].Risk_Achievement})
                 }
                this.timeArr=[{describe:'',payCount:'',dateName:'',Payment_Time:'',Charge_Amount:'',Describe:''}]
                this.nameJobArr=[{nameJobRate:'',Rate:'',visible:false,nameJobName1:'',nameJobName:'',nameJobJob:'',Lawyer_Id:'',Rule_Id:''}]
                this.riskAcount = this.riskArr.slice(1)
                this.nameJob = this.nameJobArr.slice(1)
                this.payDate = this.timeArr.slice(1)
                    
                }

                if(this.costId == 15){
                this.ChargeInfoArr = res.data.Charge
                //console.log(this.ChargeInfoArr)
                  for(var i in this.ChargeInfoArr){
                    if(this.ChargeInfoArr[i].sign == 10){
                        this.riskArr.push({riskCondition:this.ChargeInfoArr[i].Risk_Achievement,Risk_Achievement:this.ChargeInfoArr[i].Risk_Achievement})
                    }   
                 }
                //  for(var i in this.ChargeInfoArr){
                //     if(this.ChargeInfoArr[i].sign == 9){
                //         this.timeArr.push(
                //             {
                //                 Payment_Time:this.ChargeInfoArr[i].Payment_Time,
                //                 Risk_Achievement:this.ChargeInfoArr[i].Risk_Achievement,
                //                 Charge_Amount:this.ChargeInfoArr[i].Charge_Amount,
                //                 Describe:this.ChargeInfoArr[i].Describe,
                //             }
                //         )
                //     }   
                //  }
                for(var i in this.ChargeInfoArr){
                    if(this.ChargeInfoArr[i].sign == 9){
                        this.timeArr.push({describe:this.ChargeInfoArr[i].Describe,payCount:this.ChargeInfoArr[i].Charge_Amount,dateName:this.ChargeInfoArr[i].Payment_Time,Payment_Time:this.ChargeInfoArr[i].Payment_Time,Charge_Amount:this.ChargeInfoArr[i].Charge_Amount,Describe:this.ChargeInfoArr[i].Describe})
                    }
                }
                // this.timeArr=[{describe:'',payCount:'',dateName:'',Payment_Time:'',Charge_Amount:'',Describe:''}]
                this.nameJobArr=[{nameJobRate:'',Rate:'',visible:false,nameJobName1:'',nameJobName:'',nameJobJob:'',Lawyer_Id:'',Rule_Id:''}]
                this.riskAcount = this.riskArr.slice(1)
                this.nameJob = this.nameJobArr.slice(1)
                this.payDate = this.timeArr.slice(1)
                    
                }
                    //风险收费
              
                //传参
                this.dataWord = res.data
                //console.log(res)
            }).then((res)=>{
                this.getCustomInfo()
                this.getSelectMenuTwo()
            })
        },
     //文件新上传
    picUpload1(){
        this.dialogFormVisible2 = true
        this.nameData.File_Name = ''
        this.fileName = ''
    },
    //重新文件上传
     picUpload(){
        this.dialogFormVisible1 = true
        this.nameData.File_Name = ''
        this.fileName = ''
    },
    //保存上传文件
            saveDoc(){
            if(this.fileName == ''|| this.fileName==null){
               this.$message({
                    message:'文档名称不允许为空',
                    type:'warning'
                });
                return false  
                }
                  if(this.code != 200){
               this.$message({
                    message:'请先上传文件',
                    type:'warning'
                });
                return false  
                }
                //console.log(this.Case_Id)
                this.$http.get('/yongxu/Index/Del_Add_Upload',{
                 params:{
                        User_Id: localStorage.getItem('userId'),
                    Case_Id:parseInt(this.Case_Id),
                    File_Name:this.File_Name,
                    fileName:this.fileName1,
                    size:this.size,
                    Suffix_Name:this.Suffix_Name,
                 }
                }).then((res)=>{
                    //console.log(res)
                    if(res.data == true){
                          this.$message({
                        message:'保存成功',
                        type:'success'
                    });
                     this.dialogFormVisible2 = false
                     this.reload()
                    }
                    else{
                           this.$message({
                        message:'保存失败',
                        type:'warning'
                    });
                    }
                   
                }).catch((err)=>{
                    //console.log(err)
                })
            },
       //上传回调
       successFile(res){
            //console.log(res)
            if(res.code == 200){
            this.code = 200
            this.File_Name = res.File_Name
            this.Suffix_Name =res.Suffix_Name
            this.fileName1 = res.fileName
            this.size = res.size
              //console.log(this.fileName1)
             this.$message({
              message:res.message,
              type:'success'
              });  
            } 
          },
          errorFile(){
              this.$message({
                    message:'上传失败',
                    type:'warning'
                });  
          },
          progressFile(){
           
          },
          beforeFile(file){
            //console.log(file.name)
             var type =file.name.substring(file.name.lastIndexOf(".")+1).toLowerCase()
             console.log(type)
            if(type == 'bat' || type == 'exe'){
                this.$message({
                    message:'文件格式不正确',
                    type:'warning'
                    })
                    return false
            }
             var json = file.name.split(".")
             var file_name =json[0];
             this.fileName = file_name
             this.nameData.File_Name = this.fileName
          },
          //新上传
           successFile1(res){
            //console.log(res)
            if(res.code == 200){
                    this.code = 200
                    this.File_Name = res.File_Name
                    this.Suffix_Name =res.Suffix_Name
                    this.fileName1 = res.fileName
                    this.size = res.size
                    //console.log(this.fileName1)
                   this.$message({
                    message:res.message,
                    type:'success'
                    });  
                    this.dialogFormVisible1 = false
            } 
          },
          errorFile1(){
              this.$message({
                    message:'上传失败',
                    type:'warning'
                });  
          },
          progressFile1(){
           
          },
          beforeFile1(file){
            //console.log(file.name)
             var json = file.name.split(".")
             var file_name =json[0];
             this.fileName = file_name
             this.nameData.File_Name = this.fileName
          },
           handleChange (value) {
               var province = ''
          //console.log(value)
          for(var i =0;i<value.length;i++){
              if(i<value.length-1){
                province += CodeToText[value[i]] + '-'
              }else{
               province += CodeToText[value[i]] 
              }
          }
           //console.log(province)
            this.province = province
        //      //console.log(CodeToText[value])
        // //   this.selectedOptions = CodeToText[value[0]]+'/'+CodeToText[value[1]]+'/'+CodeToText[value[2]]
        //       this.province = CodeToText[value[0]]+'-'+CodeToText[value[1]]+'-'+CodeToText[value[2]]
        //       //console.log(this.province)
            }

    },
    created(){
        this.customValue=3
    },
    mounted(){
       this.getCustomerList()
       this.getCustomSelect()

       this.getCustomType()
 
       this.getJobList()
       this.getSelectMenu()
      //  this.getCustomInfo()
       this.getUpdateInfo()
       
    },
    computed:{
        //数据检索
         items: function() {
            var _search = this.search;
            if (_search) {
                //不区分大小写处理
                var reg = new RegExp(_search, 'ig')
                // //console.log(reg)
                // //console.log(this.list)
                //es6 filter过滤匹配，有则返回当前，无则返回所有
                return this.list.filter(function(e) {
                    //匹配所有字段
                    // return Object.keys(e).some(function(key) {
                    //     return e[key].match(reg);
                    // })
                    //匹配某个字段
                      return e.Customer_Name_Zh.match(reg);
                })
            };
            return this.list;
        },
    },
    components:{
        'caseWord':caseWord,
    },
}
</script>

<style lang="scss">
@import '../../assets/sass/caseAdd.scss';
@import '../../assets/sass/main.css';
.td-width{
    text-align: center;
    width:100px
}
.tr{
    cursor: pointer;
    height: 30px;
}
.tr:hover{
    background: #ccc;
}
.userInfo-first .el-input__inner{
    width: 200px;
    border-radius: 0px;
}
.address{
    width: 90%;
    margin: auto;
    margin-top: 20px;
    -webkit-box-orient: horizontal;
    -webkit-box-direction: normal;
    -ms-flex-direction: row;
    flex-direction: row;
}
.address-title{
        font-size: 14px;
    font-family: MicrosoftYaHei-Bold;
    font-weight: bold;
    color: #333333;
    min-width: 110px;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    display: -webkit-flex;
    flex-direction: column;

}
.long-width{
    width: 72.5%;
}
.rmb{
    margin-left: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    color:#999999;
}
.search_laywer_div{
    position: relative;
    width: 100%;
    
}
.search_laywer{
    border: 1px solid #999;
    border-radius: 25px;
    width: 100%;
    height: 30px;
   text-indent:40px;
}
.search_lawer_btn{
    position: absolute;
    left: 14px;
    top:9px; 
}
.inline-input{
      .el-input__inner{
                        border-radius: 50px;
                        outline: none;
                        position: relative;
                        height: 30px;
                        i{
                            position: absolute;
                            left: 14px;
                            top:9px; 
                        }
                        &:focus{
                            border-color:#ccc;
                        }
                    }
        .el-input__icon {
    height: 100%;
    width: 25px;
    text-align: center;
    -webkit-transition: all .3s;
    transition: all .3s;
    line-height: 30px;
}

}
.add-Pay-index-child .flex .el-input{
    width: 200px;
    height: 35px;
    line-height: 35px;
    input{
 border-radius: 0px;
  height: 35px;
    }
    .el-input__suffix{
    .el-input__suffix-inner{
            .el-input__icon{
                line-height: 25px !important;
            }
        }
    }
    .el-input__prefix{
        line-height: 25px;

        
        .el-icon-time{
             line-height: 25px !important;
        }
    }
}
.serve_content{
    border: 1px solid #ccc;
    margin-left: 7px;
    margin-top: 10px;
    font-size: 14px;
    font-size: 14.0pt;
    height: 100px;
    overflow: auto;
    text-overflow:ellipsis;
}
.shangchuan_btn{
    display: inline-block;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    background: #FFF;
    border: 1px solid #DCDFE6;
    color: #606266;
    -webkit-appearance: none;
    text-align: center;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    outline: 0;
    margin: 0;
    -webkit-transition: .1s;
    transition: .1s;
    font-weight: 500;
    padding: 12px 20px;
    font-size: 14px;
    color: #FFF;
    background-color: #7E2C2E;
    border-color: #7E2C2E;
    margin-left: 43px;
}
.el-popover{
    max-height: 300px;
    overflow: auto;
    min-width:310px;
}
::-webkit-input-placeholder { /* WebKit browsers */
    color:    #d3d2d2;
}
:-moz-placeholder { /* Mozilla Firefox 4 to 18 */
  color:    #d3d2d2;
   opacity:  1;
}
::-moz-placeholder { /* Mozilla Firefox 19+ */
  color:    #d3d2d2;
   opacity:  1;
}
:-ms-input-placeholder { /* Internet Explorer 10+ */
  color:    #d3d2d2;
}
.el-cascader .el-input, .el-cascader .el-input__inner{
    height: 35px;
    line-height: 35px;
     border-color: none;
}
.el-date-editor .el-input__prefix{
    top: 10px;
}
.el-date-editor .el-input__suffix{
 top: 10px;
}
.el-cascader{
    width: 200px;
    border: none;
    outline: none;
    height: 35px;
}
.el-cascader .el-input, .el-cascader .el-input__inner{
    height: 35px;
    line-height: 35px;
     border-color: none;
}
.el-cascader .el-input.is-active .el-input__inner, .el-input__inner:focus{
    outline: none;
       border-color: none;
}
.flex .el-cascader .el-input.is-focus .el-input__inner{
    border-color: none;
     outline: none;
}
.flex .el-input.is-active .el-input__inner, .el-input__inner:focus{
    border-color: none;
     outline: none;
}
.userinfoc{
    margin-bottom:30px;
}
</style>

